<?php
if ( ! defined("IN_OP") )
{
    exit("You can't access this file directly...");
}
$number = intval(getvar("number"));
$gametype = intval(getvar("gametype"));

$g_betname_3or5 = judge_type($gametype , TRUE);

if ( $number == "" )
{
	$number = 1;
}
$OK = two_long($gametype , $flag = $number == 1?TRUE:FALSE , 3);

foreach ( $OK as $key => $value )
{
	$sd = array ( 1 => "<font class=text01>单</font>" , 2 => "<font class=text02>双</font>" );
	$bs = array ( 1 => "<font class=text01>大</font>" , 2 => "<font class=text02>小</font>" );
	$color = array ( 1 => "<font color=\"red\">红</font>" , 2 => "<font color=\"blue\">蓝</font>" , 3 => "<font color=\"green\">绿</font>" );
	$four = array ( 1 => "<font color=\"saddlebrown\">福</font>" , 2 => "<font color=\"dimgray\">禄</font>" , 3 => "<font color=\"darkorange\">寿</font>" , 4 => "<font color=\"5200A0\">喜</font>" );
	$position = array ( 1 => "<font color=\"saddlebrown\">东</font>" , 2 => "<font color=\"dimgray\">南</font>" , 3 => "<font color=\"darkorange\">西</font>" , 4 => "<font color=\"5200A0\">北</font>" );
	$three = array ( 1 => "<font color=\"red\">中</font>" , 2 => "<font color=\"blue\">发</font>" , 3 => "<font color=\"green\">白</font>" );
	$animal = array ( 1 => "<font class=text01>龙</font>" , 2 => "<font class=text02>虎</font>" );
	$pc = array ( 1 => "<font class=text01>质</font>" , 2 => "<font class=text02>合</font>" );
	$key_change = substr($key , 0 , 0 - 2);
	$last = $key[strlen($key) - 1];
	if ( $g_gametype_3d [$gametype]['type'] != 3 )
	{
		$bettype = array ( 1 => "单双" , 2 => "大小" , 3 => "质合" );
		$median = array ( 1 => "个" , 2 => "拾" , 3 => "百" , 4 => "千" , 5 => "万" );
		foreach ( $bettype as $key2 => $value2 )
		{
			foreach ( $median as $key3 => $value3 )
			{
				foreach ( $g_betname_3or5 as $key4 => $value4 )
				{
					if ( substr($key , 0 , 0 - 4) == $key2 && $key[strlen($key) - 3] == $key3 )
					{
						if ( $value4 == $value3.$value2 )
						{
							$key_change = $key4;
						}
					}
				}
			}
		}
	}
	foreach ( $g_betname_3or5 as $key1 => $value1 )
	{
		if ( $key_change == $key1 )
		{
			if ( $gametype == 24 )
			{
				$type = array (
					"单双" => $sd ,
					"大小" => $bs ,
					"龙虎" => $animal ,
				);
				$show [$value1."&nbsp;-&nbsp;".$type[substr($value1 , -6)][$last]] = $value;
			}
			else if ( $g_gametype_3d [$gametype]['type'] == 3 )
			{
				$type = array (
					1 => $sd ,
					2 => $bs ,
					3 => $bs ,
					4 => $sd ,
					5 => $gametype == 20?$color:$three ,
					6 => $gametype == 20?$four:$position ,
					7 => $sd ,
					8 => $bs ,
					9 => $bs ,
					18 => $animal
				);
				$show [$value1."&nbsp;-&nbsp;".$type[substr($key , 0 , 0 - 4)][$last]] = $value;
			}
			else
			{
				$type = array (
					"单双" => $sd ,
					"大小" => $bs ,
					"质合" => $pc ,
					"虎和" => $animal
				);
				$show [$value1."&nbsp;-&nbsp;".$type[substr($value1 , 0 - 4)][$last]] = $value;
			}
		}
	}
}
$display = "<div>";
$display .= "<table class=\"tblMy3D table table-bordered\" style=\"width:100px; margin-top: -30px; z-index: 99;\">";
$display .= "<tr class=\"bgImg_{$gametype}\">";
$display .= "<td style=\"font-size:14px; padding-top:1px; padding-bottom:1px; font-family:Microsoft JhengHei; font-weight:normal;\" colspan=\"2\" align=\"center\">两面长龙排行</td></tr>";
$display .= "<tr class=\"bgImg_{$gametype}\" align=\"center\"><th style=\"font-size:14px; padding-top:1px; padding-bottom:1px; font-family:Microsoft JhengHei; font-weight:normal;\" colspan=\"2\" nowrap>";
$display .= "<label style=\"font-weight:normal;\"><input type=\"radio\" onclick=\"check_box(1)\"".( $flag?"checked":"" ).">出球</label>&nbsp;&nbsp;";
$display .= "<label style=\"font-weight:normal;\"><input type=\"radio\" onclick=\"check_box(2)\"".( $flag?"":"checked" ).">无出</label></th></tr>";
if ( isset($show) )
{
	arsort($show);
	foreach ( $show as $key => $value )
	{
		$display .= "<tr class=\"left_td2\">";
		$display .= "<td nowrap style=\"font-family:Microsoft JhengHei; padding-top:1px; padding-bottom:1px; font-size:13px; font-weight:bold; color:black; text-align:right\">&nbsp;".$key."</td>";
		$display .= "<td style=\"font-family:Microsoft JhengHei; padding-top:1px; padding-bottom:1px; font-size:13px; font-weight:bold;text-align:right\" nowrap>".$value."&nbsp;期&nbsp;</td></tr>";
	}
}
else
{
	$display .= "<tr class=\"left_td2\" align=\"center\">";
	$display .= "<td nowrap>无资料</td>";
	$display .= "<td nowrap>无资料</td></tr>";
}
$display .= "</table></div>";
echo $display;
?>